home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 August / ENTER.ISO / files / gimp-2.0.5-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / alien-glow-bar.scm < prev    next >
Encoding:
Text File  |  2004-09-26  |  3.3 KB  |  90 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; Alien Glow themed hrule for web pages
  4. ; Copyright (c) 1997 Adrian Likins
  5. ; aklikins@eos.ncsu.edu
  6. ;
  7. ; This program is free software; you can redistribute it and/or modify
  8. ; it under the terms of the GNU General Public License as published by
  9. ; the Free Software Foundation; either version 2 of the License, or
  10. ; (at your option) any later version.
  11. ; This program is distributed in the hope that it will be useful,
  12. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ; GNU General Public License for more details.
  15. ; You should have received a copy of the GNU General Public License
  16. ; along with this program; if not, write to the Free Software
  17. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. (define (script-fu-alien-glow-horizontal-ruler length
  20.                            height
  21.                            glow-color
  22.                            bg-color
  23.                            flatten)
  24.   (let* ((img (car (gimp-image-new height length RGB)))
  25.      (border (/ height 4))
  26.      (ruler-layer (car (gimp-layer-new img
  27.                        (+ length height) (+ height height)
  28.                        RGBA-IMAGE "Ruler" 100 NORMAL-MODE)))
  29.      (glow-layer (car (gimp-layer-new img
  30.                       (+ length height) (+ height height)
  31.                       RGBA-IMAGE "ALien Glow" 100 NORMAL-MODE)))
  32.      (bg-layer (car (gimp-layer-new img
  33.                     (+ length height) (+ height height)
  34.                     RGB-IMAGE "Backround" 100 NORMAL-MODE)))
  35.      (old-fg (car (gimp-palette-get-foreground)))
  36.      (old-bg (car (gimp-palette-get-background))))
  37.     (gimp-image-undo-disable img)
  38.     (gimp-image-resize img (+ length height) (+ height height) 0 0)
  39.     (gimp-image-add-layer img bg-layer 1)
  40.     (gimp-image-add-layer img glow-layer -1)
  41.     (gimp-image-add-layer img ruler-layer -1)
  42.      
  43.    ; (gimp-layer-set-preserve-trans ruler-layer TRUE)
  44.     (gimp-palette-set-background bg-color)
  45.     (gimp-edit-fill bg-layer BACKGROUND-FILL)
  46.     (gimp-edit-clear glow-layer)
  47.     (gimp-edit-clear ruler-layer)
  48.     
  49.     (gimp-rect-select img (/ height 2) (/ height 2) length height CHANNEL-OP-REPLACE FALSE 0)
  50.     (gimp-palette-set-foreground '(79 79 79))
  51.     (gimp-palette-set-background '(0 0 0))
  52.  
  53.     (gimp-edit-blend ruler-layer FG-BG-RGB-MODE NORMAL-MODE
  54.              GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
  55.              FALSE 0 0 TRUE
  56.              0 0 height height)
  57.  
  58.     (gimp-palette-set-foreground glow-color)
  59.     (gimp-selection-grow img border)
  60.     (gimp-edit-fill glow-layer FOREGROUND-FILL)
  61.     (gimp-selection-none img)
  62.     (plug-in-gauss-rle 1 img glow-layer 25 TRUE TRUE)
  63.  
  64.     (gimp-palette-set-background old-bg)
  65.     (gimp-palette-set-foreground old-fg)
  66.     (gimp-image-undo-enable img)
  67.  
  68.     (if (= flatten TRUE)
  69.     (gimp-image-flatten img))
  70.  
  71.     (gimp-display-new img)))
  72.  
  73.  
  74. (script-fu-register "script-fu-alien-glow-horizontal-ruler"
  75.             _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Alien Glow/_Hrule..."
  76.             "Create an Hrule with the Alien Glow look"
  77.             "Adrian Likins"
  78.             "Adrian Likins"
  79.             "1997"
  80.             ""
  81.             SF-ADJUSTMENT _"Bar Length"       '(480 5 1500 1 10 0 1)
  82.             SF-ADJUSTMENT _"Bar Height"       '(16 1 100 1 10 0 1)
  83.             SF-COLOR      _"Glow Color"       '(63 252 0)
  84.             SF-COLOR      _"Background Color" '(0 0 0)
  85.             SF-TOGGLE     _"Flatten Image"    TRUE)
  86.